package com.steel.yfmall.cloud.assistant.controller;

import com.steel.yfmall.cloud.assistant.account.AccountBaseService;
import com.steel.yfmall.cloud.assistant.dto.para.account.ParaAcountBaseBean;
import com.steel.yfmall.cloud.assistant.dto.para.account.ParaCloseAccountInfoBean;
import com.steel.yfmall.cloud.assistant.dto.para.account.ParaERPUserInfoBean;
import com.steel.yfmall.cloud.components.utils.base.APIMsgBean;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class UserAcountInfoController {
    /**
     * 苍穹修改用户信息,将账号信息同步电商,审核结果同步电商
     *
     * @param paraUserBaseBean
     * @return com.steel.yfmall.cloud.components.utils.base.APIMsgBean<java.lang.Boolean>
     * @author 张兆民
     * @date 2021/3/28 9:34
     */
    @RequestMapping("/userAccountInfo")
    public APIMsgBean<Boolean> userAccountInfo(@RequestBody ParaAcountBaseBean paraUserBaseBean) {
        return accountBaseService.accountSyncInfo(paraUserBaseBean);
    }

    /**
     * 苍穹获取erp客户编码，返回给电商
     *
     * @param paraERPUserInfoBean
     * @return com.steel.yfmall.cloud.components.utils.base.APIMsgBean<java.lang.Boolean>
     * @author 姚侃
     * @date 2021/4/7 9:34
     */
    @RequestMapping("/updateERPUserName")
    public APIMsgBean<Boolean> updateERPUserName(@RequestBody ParaERPUserInfoBean paraERPUserInfoBean) {
        return accountBaseService.updateERPUserName(paraERPUserInfoBean);
    }


    /**
     *closeAccountInfo：关闭子账户信息
     *
     * @param paraCloseAccountInfoBean
     * @return com.steel.yfmall.cloud.components.utils.base.APIMsgBean<java.lang.Boolean>
     *
     */
    @RequestMapping("/closeAccountInfo")
    public APIMsgBean<Boolean> closeAccountInfo(@RequestBody ParaCloseAccountInfoBean paraCloseAccountInfoBean) {
        return accountBaseService.closeAccountInfo(paraCloseAccountInfoBean);
    }

    @Resource
    private AccountBaseService accountBaseService;
}
